<%@ page language="java" import="java.util.*,com.shop.domain.*,com.shop.dao.*" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!doctype html>
<html lang="cmn-Hans-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<!--引入bootstrap的CSS文件 -->
<link rel="stylesheet" href="../css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="../css/bootstrap-theme.min.css"
	type="text/css" />
<link rel="stylesheet" href="../css/admin.css" />
<!--引入jquery的js文件-->

<script type="text/javascript" src="../js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="../js/bootstrap.js"></script>
<script src="../js/admin.js"></script>
</head>
<body>
<div class="container" style="margin-bottom:0">
<%!Admin a = new Admin();%>
<%
try{
	String username = request.getParameter("username");
	out.println(username);
	AdminDao ad = new AdminDao();
	a = ad.find(username);
	session.setAttribute("Admin", a);
}catch(Exception e){
	e.printStackTrace();
}
%>
<h3>编辑管理员</h3>
	<form action="EditAdmin" method="post"  class="form-horizontal" role="form">
		<div class="form-group">
				<label class="col-sm-2 control-label">管理员名称</label>
				<div class="col-sm-4"><input class="form-control" name="username" type="text" value="${sessionScope.Admin.username}" /></div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">管理员密码</label>
				<div class="col-sm-4"><input class="form-control" name="password" type="text" value="${sessionScope.Admin.password}" ></div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">管理员邮箱</label>
				<div class="col-sm-4"><input class="form-control" name="email" type="email" value="${sessionScope.Admin.email}" /></div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">权限等级</label>
				<div class="col-sm-4"><input class="form-control" name="level" type="number" min="1" max="3" value="${sessionScope.Admin.level}" /></div>
			</div>
			<div class="form-group">
			<label class="col-sm-2 control-label"></label>
			    <button class="btn btn-default" type="submit" value="修改">修改</button>
			</div>
	</form>
	</div>
</body>
</html>